#include "execute_instructions.hpp"

void execute_instructions(std::vector<token> program)
{
    size_t current_token = 0;
    while(true)
    {
        if(program[current_token].is_end_of_file())
        {
            exit(0);
        }
        else if(program[current_token].is_command() and program[current_token].get_string() == "END")
        {
            exit(0);
        }
        else if(program[current_token].is_command() and program[current_token].get_string() == "CLS")
        {
            system("CLS");
        }
        else
        {
            error_and_terminate("unrecognised command");
        }
        ++current_token;
    }
}
